<?php while (have_posts()) : the_post(); ?>
	
	<div class="post" id="<?php the_ID() ?>">
		<div class="row">
			<div class="ninecol last">
				<h1><?php the_title() ?></h1>
				<h2 id="credit"><?php display_credit() ?></h2>
			</div>
		</div>
		<div class="row">
			<div class="ninecol">
				<div id="photos">
				<?php 
					// pass the photoset object the photoset url
					// expects the_content() to be photoset url (ex: http://www.flickr.com/photos/user/sets/999/)
					$photoset = new photoset(get_the_content());
					
					$photoset->render();
				?>
				</div>
				<div id="comments">
					<?php comments_template() ?>
				</div>
			</div>
			<div class="threecol last" id="sidebar">
				<div id="photoset_info">
					<h2>Photoset info</h2>
					<?php
						$photoset->render_info();
					?>
				</div>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
		var $container = $('#photos');

		$container.imagesLoaded( function(){
			$container.masonry({
				itemSelector : '.photobox',
			});	
		});
	</script>
	
<?php endwhile; ?>